/*
Realistic Unit Modification v4.0 Dialog 
v4.0.0.1 [ALPHA]
Concept & Development by Draper & Raps | [VRC]
*/

private ["_which","_param","_man","_pilot","_planecallsign","_stg1","_stg2","_stg3","_callline","_checkin1","_checkin2","_checkin4","_checkin5","_cl5","_cl4","_cl3","_cl2","_dir","_dis","_line3","_line4","_line5","_cl1","_type"];

/* defined variables */
_which = _this select 0;
_param = _this select 1;

/* based on param sent, defines dialog to be used */
switch (_which) do {
	case "immediatestrike": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		
		_stg1 = RUM_RADIO_AssetProvider + " " + "this is" + " " + RUM_COM_Callsign + ", " + "Requesting immediate sortie from" + " " + _planecallsign + ", " + "target with ingress and egress has been logged, over";
		_man sidechat toUpper(_stg1);
		sleep (10 + random 5);
		_stg2 = RUM_COM_Callsign + " " + "this is" + " " + RUM_RADIO_AssetProvider + ", " + "Request granted, stand by for flight, out";
		[side _man,"HQ"] sideChat toUpper(_stg2);
		_stg3 = RUM_COM_Callsign + " " + "this is" + " " + _planecallsign + ", " + "Oscar Mike, out";
		sleep (20 + random 5);
		_pilot sidechat toUpper(_stg3);
	};
	case "sendtostation": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		
		_stg1 = RUM_RADIO_AssetProvider + " " + "this is" + " " + RUM_COM_Callsign + ", " + "Requesting immediate sortie from" + " " + _planecallsign + ", " + "put on station, over";
		_man sidechat toUpper(_stg1);
		sleep (10 + random 5);
		_stg2 = RUM_COM_Callsign + " " + "this is" + " " + RUM_RADIO_AssetProvider + ", " + "Request granted, stand by for flight, out";
		[side _man,"HQ"] sideChat toUpper(_stg2);
	};
	case "flightcheckin": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		
		_callline = RUM_COM_Callsign + " " + "this is" + " " + _planecallsign + " " + "entering your AO, say when ready for check in";
		_pilot sideChat toUpper(_callline);
		sleep (5 + random 5);
		_cl2 =  "this is" + " " + RUM_COM_Callsign + ", " + "send it, over";
		_man sideChat toUpper(_cl2);
		sleep (2 + random 3);
		_checkin1 = RUM_COM_Callsign + " " + "this is" + " " + _planecallsign + " " + "in support of" + " " + RUM_RADIO_MissionName;
		_checkin2 = "currently in a holding pattern at grid" + " " + (mapGridPosition _pilot);
		_checkin4 = "A play time of 2 hours";
		_checkin5 = "Abort code for this mission is RAMROD";
		_pilot sideChat toUpper(_checkin1);
		sleep (2 + random 3);
		_pilot sideChat toUpper(_checkin2);
		sleep (2 + random 3);
		_pilot sideChat toUpper(_checkin4);
		sleep (2 + random 3);
		_pilot sideChat toUpper(_checkin5);
		sleep (2 + random 3);
		_pilot sideChat toUpper("How Copy, over");
		sleep (5 + random 5);
		_cl3 = "Roger" + " " + _planecallsign + ", " + "Good Copy, over";
		_man sideChat toUpper(_cl3);
		sleep (2 + random 3);
		_cl4 = "My current location is" + " " + (mapGridPosition _man) + ", " + "Out";
		_man sideChat toUpper(_cl4);
		sleep (5 + random 5);
		_cl5 = "Roger" + " " + RUM_COM_Callsign + ", " + "standing by for 5-line requests" + ", " + "Out";
		_pilot sideChat toUpper(_cl5);
	};
	case "5line": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		_dir = _param select 3;
		_dis = _param select 4;
		
		_callline = _planecallsign + " " + "this is" + " " + RUM_COM_Callsign + " " + "Target Handover" + ", " + "Over";
		_man sideChat toUpper(_callline);
		sleep (5 + random 5);
		_cl2 =  "this is" + " " + _planecallsign + ", " + "send it" + ", " + "over";
		_pilot sideChat toUpper(_cl2);

		_line3 = "My position " + (mapGridPosition _man);
		_line4 = "Target" + ", " + (format ["%1",_dir])+ " " + "degrees" + ", " + (format ["%1",_dis]) + " " + "meters";
		_line5 = "Ingress and egress for target has been logged";
		_cl1 = "Roger" + " " + _planecallsign + ", " + "Good Copy" + ", " + "Tally Target" + ", " + (format ["%1",_dir])+ " " + "degrees" + ", " + (format ["%1",_dis]) + " " + "meters" + ", out";
		
		sleep (2 + random 3);
		_man sideChat toUpper(_line3);
		sleep (2 + random 3);
		_man sideChat toUpper(_line4);
		sleep (2 + random 3);
		_man sideChat toUpper("How Copy, over");
		sleep (5 + random 5);
		_pilot sideChat toUpper(_cl1);
		sleep (2 + random 3);
		_man sideChat toUpper("Target Confirmed, Cleared to Engage");
		sleep (5 + random 5);
	};
	case "RTB": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		
		_callline = _planecallsign + " " + "this is" + " " + RUM_COM_Callsign + " " + "Abort code Ramrod" + ", " + "repeat" + ", " + "Abort code Ramrod" + ", " + "Out";
		_man sideChat toUpper(_callline);
		sleep (5 + random 5);
		_cl2 =  "this is" + " " + _planecallsign + ", " + "Abort confirmed" + ", " + "Out";
		_pilot sideChat toUpper(_cl2);
	};
	case "callfire": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		_type = _param select 3;
		
		_callline = _planecallsign + " " + "this is" + " " + RUM_COM_Callsign + " " + "Request" + " " + _type + " " + "fire on sparkle" + ", " + "Over";
		_man sideChat toUpper(_callline);
		sleep (5 + random 5);
		_cl2 = "Roger " + RUM_COM_Callsign + ", standing by for sparkle, Over";
		_pilot sideChat toUpper(_cl2);
		sleep 5;
		dialogOver = true;
	};
	case "movestation": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		_pos = _param select 3;
		
		_callline = _planecallsign + " " + "this is" + " " + RUM_COM_Callsign + " " + "Change station point to" + " " + (mapGridPosition _man) + ", " + "Over";
		_man sideChat toUpper(_callline);
		sleep (5 + random 5);
		_cl2 = RUM_COM_Callsign + " " + "this is" + " " + _planecallsign + ", " + "Wilco" + ", " + "Oscar Mike" + ", " + "Out";
		_pilot sideChat toUpper(_cl2);
	};
	case "ammo": {
		WINCHESTER;
	};
	case "fuel": {
		BINGO;
	};
	case "afterRTB": {
		_man = _param select 0;
		_pilot = _param select 1;
		_planecallsign = _param select 2;
		
		_callline = RUM_COM_Callsign + " " + "this is" + " " + _planecallsign + " " + " || Rearm and refuel complete, standing by for deployment as needed." + ", " + "repeat" + ", " + "Standing by" + ", " + " || Out";
		_pilot sideChat toUpper(_callline);
	};
};

if(true)exitwith{};